<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.com">
	<head>
		<meta charset="UTF-8">
		<title></title>
		<!--引入layui.css -->
		<link rel="stylesheet" href="/layui/css/layui.css"/>
		<!--引入layui.js -->
		<script type="text/javascript" src="/layui/layui.js"></script>
	</head>
	<body>
<!--    <h5 align="center" style="color:greenyellow;font-size: 24px"><b>课程名称：Java程序设计</b></h5>-->
		<h5 align="center" style="color:greenyellow;font-size: 22px"><b>已选学生列表</b></h5>
		
		<table class="layui-table">
			<tr>
				<td>全选</td>
				<td>学号</td>
				<td>姓名</td>
				<td>性别</td>
				<td>班级</td>
				<td>成绩</td>
				<td>录入成绩</td>
			</tr>
			<tr th:each="student:${pageHelper.list}">
				<td><input type="checkbox"/></td>
				<td th:text="${student.s_num}">1</td>
				<td th:text="${student.s_name}">张三</td>
				<td th:text="${student.s_sex}">男</td>
				<td th:text="${student.s_class}">2002班</td>
				<td th:text="${student.grade}">0</td>
				<td>
					<form th:action="@{/student/addgrade(Sname=${student.s_num},Cid=${student.c_id})}">
						<input type="hidden" name="Sname" th:value="${student.s_num}">
						<input type="hidden" name="Cid" th:value="${student.c_id}">
						<input type="text" name="grade" style="height:22px;width: 34px;margin-top:20px;" placeholder="分数">
						<input type="submit" style="height:25px;width: 50px;margin-top:20px;" value="录入">
					</form>
				</td>
				
			</tr>
			<tr th:each="student,stat:${pageHelper.list}" th:if="${stat.index == 0}">
				<td colspan="9">
					<a th:href="'/student/list?pageNum=1&Cid='+${student.c_id}">首页</a>
					|
					<a th:if="${pageHelper.pageNum>1}"th:href="'/student/list?pageNum='+${pageHelper.pageNum-1}+'&Cid='+${student.c_id}">上一页</a>
					<label th:if="${pageHelper.pageNum==1}" style="color: gray">上一页</label>
					|
					当前第<label th:text="${pageHelper.pageNum}"></label>页
					/
					共<label th:text="${pageHelper.pageCount}"></label>页
					|
					<a th:if="${pageHelper.pageNum<pageHelper.pageCount}"th:href="'/student/list?pageNum='+${pageHelper.pageNum+1}+'&Cid='+${student.c_id}">下一页</a>
					<label th:if="${pageHelper.pageNum==pageHelper.pageCount}">下一页</label>
					|
					<a th:href="'/student/list?pageNum='+${pageHelper.pageCount}+'&Cid='+${student.c_id}">尾页</a>
				</td>
			</tr>
		</table>
		
	</body>
</html>
